package cn.iocoder.yudao.module.cdk.dal.mysql.cdklog;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.cdk.controller.admin.cdklog.vo.CdklogPageReqVO;
import cn.iocoder.yudao.module.cdk.dal.dataobject.cdklog.CdklogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * cdk登录日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CdklogMapper extends BaseMapperX<CdklogDO> {

    default PageResult<CdklogDO> selectPage(CdklogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CdklogDO>()
                .betweenIfPresent(CdklogDO::getLogintime, reqVO.getLogintime())
                .eqIfPresent(CdklogDO::getCdkCdkuserid, reqVO.getCdkCdkuserid())
                .betweenIfPresent(CdklogDO::getExittime, reqVO.getExittime())
                .eqIfPresent(CdklogDO::getImei, reqVO.getImei())
                .eqIfPresent(CdklogDO::getMac, reqVO.getMac())
                .eqIfPresent(CdklogDO::getIp, reqVO.getIp())
                .eqIfPresent(CdklogDO::getCdk, reqVO.getCdk())
                .eqIfPresent(CdklogDO::getQq, reqVO.getQq())
                .eqIfPresent(CdklogDO::getPhone, reqVO.getPhone())
                .likeIfPresent(CdklogDO::getUsername, reqVO.getUsername())
                .orderByDesc(CdklogDO::getId));
    }

}